const path = require('path');
const webpack = require('webpack');
const configEnv = process.env.CONFIG_ENV;

module.exports = {
    devServer: {
        host: '0.0.0.0',
        port: 8080,
        open: true,
        proxy: {
            '/v1': {
                target: 'https://www.fastmock.site/mock/b0e7c0fd4d0c17abe3d7bda7f9be5104/demo',
                changeOrigin: true
            },
            '/v2': {
                target: 'https://www.fastmock.site/mock/b0e7c0fd4d0c17abe3d7bda7f9be5104/demo',
                changeOrigin: true
            }
        },
        disableHostCheck: true
    },
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                feConfig: path.resolve('.', './src/feConfig/' + (configEnv || 'development')),
                Util: path.resolve('.', './src/utils/util'),
                Enums: path.resolve('.', './src/contants/enum')
            })
        ]
    },
    transpileDependencies: ['luch-request']
};
